package com.aspose.cells;

class zaxj extends zawf {
   private zahn[] a;
   private int b;
   private int c;
   private int d;
   private int e;
   private int f;
   private int g;
   private int h;
   private zahn i;

   public zaxj(zahn[] var1, int var2, int var3) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
      int var4 = -1;
      int var5 = -1;
      int var6 = Integer.MAX_VALUE;
      int var7 = -1;
      --var3;

      for(int var9 = 0; var9 < var1.length; ++var9) {
         this.i = var1[var9];
         if (this.i != null) {
            int var8 = this.i.s();
            if (var8 > -1) {
               var5 = var9 * var2 + var8;
               if (var4 < 0) {
                  var4 = var9 * var2 + this.i.r();
               }

               if (var6 > 0) {
                  var6 = Math.min(this.i.t(), var6);
               }

               if (var7 < var3) {
                  var7 = Math.max(this.i.u(), var7);
               }
            } else {
               var1[var9] = null;
            }
         }
      }

      if (var5 < 0) {
         this.e = -1;
         this.d = -1;
         this.g = -1;
         this.f = -1;
      } else {
         this.e = var5;
         this.d = var4;
         this.g = var7;
         this.f = var6;
      }

      this.h = var1.length;
   }

   zaxj(zaxj var1, zaay var2) {
      this.a = new zahn[var1.a.length];

      for(int var3 = 0; var3 < this.a.length; ++var3) {
         this.a[var3] = var1.a[var3].b(var2);
      }

      this.b = var1.b;
      this.c = var1.c;
      this.d = var1.d;
      this.e = var1.e;
      this.f = var1.f;
      this.g = var1.g;
   }

   public zahn b(zaay var1) {
      return new zaxj(this, var1);
   }

   zahn[] C() {
      return this.a;
   }

   public int c() {
      return this.b * this.a.length;
   }

   public int d() {
      return this.c;
   }

   public int e() {
      return this.c() * this.c;
   }

   public boolean l() {
      return false;
   }

   public boolean m() {
      return false;
   }

   public boolean n() {
      return this.c < 2;
   }

   public zagu a(int var1, int var2) {
      zahn var3 = this.a[var1 / this.b];
      return var3 == null ? null : var3.a(var1 % this.b, var2);
   }

   public int b() {
      return 9;
   }

   public void f() {
      if (this.e >= 0) {
         this.h = 0;
         this.i = this.a[this.h];
         if (this.i != null) {
            this.i.f();
         } else {
            do {
               ++this.h;
               if (this.h == this.a.length) {
                  return;
               }

               this.i = this.a[this.h];
            } while(this.i == null);

            this.i.f();
         }
      }
   }

   public boolean b(int var1, int var2) {
      this.h = var1 / this.b;
      this.i = this.a[this.h];
      return this.i != null && this.i.b(var1 % this.b, var2) ? true : this.D();
   }

   public boolean a(int var1) {
      int var2 = var1 % this.c;
      int var3 = var1 / this.c;
      return this.b(var3, var2);
   }

   public boolean g() {
      if (this.h < this.a.length) {
         return this.i.g() ? true : this.D();
      } else {
         return false;
      }
   }

   private boolean D() {
      while(true) {
         ++this.h;
         if (this.h == this.a.length) {
            return false;
         }

         this.i = this.a[this.h];
         if (this.i != null) {
            this.i.f();
            if (this.i.g()) {
               return true;
            }
         }
      }
   }

   public zagu h() {
      return this.i.h();
   }

   public int i() {
      return this.b * this.h + this.i.i();
   }

   public int j() {
      return this.i.j();
   }

   public int k() {
      return (this.b * this.h + this.i.i()) * this.c + this.i.j();
   }

   public zahn b(int var1) {
      zahn var2 = this.a[var1 / this.b];
      return (zahn)(var2 == null ? new zawz((zagu)null, 9, 1, this.c) : var2.b(var1 % this.b));
   }

   public zahn c(int var1) {
      zahn[] var2 = new zahn[this.a.length];

      for(int var3 = 0; var3 < var2.length; ++var3) {
         if (this.a[var3] != null) {
            var2[var3] = this.a[var3].c(var1);
         }
      }

      return new zaxj(var2, this.b, 1);
   }

   public zahn c(zaay var1) {
      zahn[] var2 = null;

      for(int var4 = 0; var4 < this.a.length; ++var4) {
         if (this.a[var4] != null) {
            zahn var3 = this.a[var4].c(var1);
            if (var3 != this.a[var4]) {
               var2 = new zahn[this.a.length];
               System.arraycopy(this.a, 0, var2, 0, var4);
               var2[var4] = var3;
               ++var4;

               for(; var4 < this.a.length; ++var4) {
                  if (this.a[var4] != null) {
                     var2[var4] = this.a[var4].c(var1);
                  }
               }

               return new zaxj(var2, this.b, this.c);
            }
         }
      }

      return this;
   }

   public boolean a() {
      for(int var1 = 0; var1 < this.a.length; ++var1) {
         if (this.a[var1] != null && !this.a[var1].a()) {
            return false;
         }
      }

      return true;
   }

   public void a(boolean var1) {
      for(int var2 = 0; var2 < this.a.length; ++var2) {
         if (this.a[var2] != null) {
            this.a[var2].a(var1);
         }
      }

   }

   public boolean x() {
      for(int var1 = 0; var1 < this.a.length; ++var1) {
         if (this.a[var1] != null && !this.a[var1].x()) {
            return true;
         }
      }

      return false;
   }

   public boolean y() {
      for(int var1 = 0; var1 < this.a.length; ++var1) {
         if (this.a[var1] != null && !this.a[var1].y()) {
            return true;
         }
      }

      return false;
   }

   public boolean q() {
      return true;
   }

   public int r() {
      return this.d;
   }

   public int s() {
      return this.e;
   }

   public int t() {
      return this.f;
   }

   public int u() {
      return this.g;
   }
}
